package com.lianniu.mgr.teaProduct.model;

import java.util.HashMap;
import java.util.Map;

public class TeaSearch {

	public static Map<String,String> getSearch(String sex,String age,String price,String hire,String proType,String prov,String city,String area){
		HashMap<String,String> param = new HashMap<String,String>();
		if(sex!=null){
			if(sex.equals("0")){
				param.put("sex", "0"); //女
			}else if(sex.equals("1")){
				param.put("sex", "1");//男
			}
		}
		if(age!=null){
			if(age.contains("-")){
				String[] split = age.split("-");
				param.put("ageSta", split[0]);
				param.put("ageEnd", split[1]);
			}else if(age.equals("")){
				
			}else{
				param.put("ageSta", age);
			}
		}
		if(price!=null){
			if(price.contains("-")){
				String[] split = price.split("-");
				param.put("priceSta", split[0]);
				param.put("priceEnd", split[1]);
			}else if(price.equals("")){
				
			}else{
				param.put("priceSta", price);
			}
		}
		if(hire!=null){
			if(hire.equals("0")){
				param.put("hire", "0"); //日聘
			}else if(sex.equals("1")){
				param.put("hire", "1");//月聘
			}
		}
		if(proType!=null){
			param.put("proType", proType);
		}
		if(area!=null){
			if(area.equals("")){
				if(city!=null){
					if(city.equals("")){
						if(prov!=null){
							if(prov.equals("")){
								
							}else{
								param.put("location",prov);
							}
						}
					}else{
						param.put("location",city);
					}
				}else{
					
				}
			}else{
				param.put("location",area);
			}
		}
		
		return param;
	}
	
	

}
